package acwing.高精度;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * @description:
 * @author: qian
 * @createDate: 2021/11/5
 */
public class BidDiv {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String str = s.next(); // 数字1
        int B = s.nextInt(); // 数字2
        char[] a = str.toCharArray();
        List<Integer> A = new ArrayList<>();
        for (int i = a.length - 1; i >= 0; i--) A.add(a[i] - '0');


        List C = div(A,B);
        for (int i =  C.size() - 1; i >= 0; i--) {
            System.out.print(C.get(i));
        }
    }
    // a / b 商是 c r是余数
    private static List div(List<Integer> a, int b) {
        int r = 0;
        List<Integer> c = new ArrayList<>();
        for (int i = a.size() - 1; i >= 0; i--) {
            r = r * 10 + a.get(i);
            c.add(r / b);
            r %= b;
        }
        Collections.reverse(c);
        while (c.size() > 1 && c.get(c.size() - 1) == 0) c.remove(c.size() - 1);
        System.out.println(r);
        return c;

    }
}
